﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CustomerCare.ascx.cs" Inherits="ERP.Modules.CustomerCare" %>
 <%-------------------------------%>
<ext:Hidden ID="FormatTypeCustomerCare" runat="server" />
<%--------------GridCustomerCare-----------------%>
<ext:Panel ID="PanelCustomerCare" runat="server" Layout="Fit" Border="False">
    <Content>
        <ext:GridPanel
            ID="grCustomerCare"
            runat="server"
            Cls="grid-double"
            EnableColumnMove="true"
            Border="False">
            <Store>
                <ext:Store
                    ID="StoreCustomerCare"
                    runat="server"
                    OnReadData="StoreCustomerCare_RefreshData"
                    PageSize="20">
                    <Model>
                        <ext:Model runat="server" IDProperty="ID" GroupField="Form_Name">
                            <Fields>
                                <ext:ModelField Name="ID_Form" Type="Int" />
                                <ext:ModelField Name="Code" Type="String" />
                                <ext:ModelField Name="Form_Name" Type="String" />
                                <ext:ModelField Name="Subjects" Type="String" />
                                <ext:ModelField Name="DateBegin" Type="String" />
                                <ext:ModelField Name="DateEnd" Type="Date" />
                                <ext:ModelField Name="IsActive" Type="Boolean" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:RowNumbererColumn runat="server" Width="30" Align="Center" />
                    <ext:Column runat="server" Text="Mã phiếu" Width="115" DataIndex="Code"/>
                    <ext:Column runat="server" Text="Tên biểu mẫu" Width="115" DataIndex="Form_Name" Align="Center"/>
                    <ext:Column runat="server" Text="Tiêu đề" Width="131" DataIndex="Subjects" Align="Center" Visible="False"/>
                    <ext:DateColumn runat="server" Text="Ngày bắt đầu" Width="157" DataIndex="DateBegin" Format="dd-MM-yyyy" Align="Center"/>
                    <ext:DateColumn runat="server" Text="Ngày kết thúc" Width="160" DataIndex="DateEnd" Format="dd-MM-yyyy" Align="Center"/>
                    <ext:CheckColumn runat="server" Text="Hình thức" Width="122" DataIndex="IsActive" Flex="1" Align="Center"/>
                </Columns>
            </ColumnModel>
            <Features>
                <ext:Grouping
                    runat="server" 
                    HideGroupedHeader="true"
                    GroupByText="Xem theo phân nhóm"
                    ShowGroupsText="Phân nhóm"
                    GroupHeaderTplString="{name} ({rows.length} danh mục con {[values.rows.length > 1 ? '' : '']})"
                    StartCollapsed="True" />
            </Features>
            <DirectEvents>
                <ItemDblClick OnEvent="CustomerCareDblClick">
                    <ExtraParams>
                        <ext:Parameter Name="ID" Value="record.data.ID" Mode="Raw" />
                    </ExtraParams>
                    <EventMask ShowMask="true" Msg="Đang tải..." />
                </ItemDblClick>
            </DirectEvents>
            <SelectionModel>
                <ext:CheckboxSelectionModel runat="server" Mode="Multi">
                    <Listeners>
                        <SelectionChange Handler="
                            if (selected.length == 0) {
                                #{btnEdit}.disable();
                                #{btnDel}.disable();
                                #{btnSendMail}.disable();
                            } else {
                                #{btnEdit}.enable();
                                #{btnDel}.enable();
                                #{btnSendMail}.enable();
                            }" />
                    </Listeners>
                </ext:CheckboxSelectionModel>
            </SelectionModel>
            <View>
                <ext:GridView runat="server" StripeRows="true" />
            </View>
            <DockedItems>
                <ext:Toolbar runat="server" Dock="Top">
                    <Items>
                        <ext:Button ID="btnAddNew" runat="server" Text="Thêm mới" Icon="ApplicationAdd">
                            <DirectEvents>
                                <Click OnEvent="btnAddNew_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents> 
                        </ext:Button>
                        <ext:ToolbarSeparator />
                        <ext:Button ID="btnEdit" runat="server" Text="Sửa" Icon="ApplicationEdit">
                            <DirectEvents>
                                <Click OnEvent="btnEdit_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:ToolbarSeparator />
                        <ext:Button ID="btnDel" runat="server" Text="Xoá" Icon="ApplicationDelete">
                            <DirectEvents>
                                <Click OnEvent="btnDel_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                    <ExtraParams>
                                        <ext:Parameter Name="name" Value="btnDel"></ext:Parameter>
                                    </ExtraParams>
                                    <Confirmation ConfirmRequest="true"
                                        Title="Thông Báo" Message="Bạn có muốn xoá mẫu tin này không ?">
                                    </Confirmation>
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:ToolbarSeparator />
                        <ext:DateField ID="txtDateBeginFillter" EmptyText="Từ ngày" runat="server" MarginSpec="0 8 0 0"/>
                        <ext:DateField ID="txtDateEndFillter" EmptyText="Đến ngày" runat="server" MarginSpec="0 5 0 0"/>
                        <ext:Button ID="btnFillter" runat="server" Text="Lọc" Icon="ApplicationGo" ToolTip="Chọn lọc theo ngày đặt hàng">
                            <DirectEvents>
                                <Click OnEvent="btnFillter_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                    </Items>
                </ext:Toolbar>
                <ext:Toolbar runat="server" Dock="Bottom" AnchorHorizontal="100%">
                    <Items>
                        <ext:TriggerField ID="txtSearch" runat="server" Width="200" EnableKeyEvents="true" MarginSpec="0 8 0 0">
                            <Triggers>
                                <ext:FieldTrigger Icon="Search" />
                            </Triggers>
                            <DirectEvents>
                                <TriggerClick OnEvent="Search_Event">
                                        <EventMask ShowMask="true" Msg="Đang tải..." />
                                </TriggerClick>
                                <SpecialKey OnEvent="Search_Event" Before="return e.getKey() == Ext.EventObject.ENTER;">
                                        <EventMask ShowMask="true" Msg="Đang tải..." />
                                </SpecialKey>
                            </DirectEvents>
                        </ext:TriggerField>
                        <ext:PagingToolbar runat="server" StoreID="StoreCustomerCare" BeforePageText="Trang" AfterPageText="của {0}" LastText="Cuối" NextText="Kế tiếp" PrevText="Trở lại" FirstText="Đầu" RefreshText="Làm tươi" DisplayInfo="true" DisplayMsg="Trang {0} - {1} của {2}" />
                    </Items>
                </ext:Toolbar>
            </DockedItems>
        </ext:GridPanel>
    </Content>
</ext:Panel>
<ext:Panel runat="server">
    <Content>
        <%-----------------WindowsCustomerCare-----------------%>
        <ext:Window ID="WindowsOrderCustomerCare" runat="server"
            Title="Cập nhật chăm sóc khách hàng"
            Width="975"
            Height="534"
            Hidden="true"
            Region="Center"
            Modal="true"
            HideMode="Display"
            Border="false"
            Padding="5"
            DefaultButton="btnSavePopUp"
            Resizable="False">
            <Items>
                <ext:Toolbar runat="server">
                    <Items>
                        <ext:Button runat="server" Text="Lưu lại" Icon="Disk" ID="btnSavePopUp">
                            <DirectEvents>
                                <Click OnEvent="btnSavePopUp_Click" Before="return #{FormPanelCustomerCare}.isValid();">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:ToolbarSeparator />
                        <ext:Button ID="btnSendMail" runat="server" Text="Gửi Mail" Icon="EmailGo">
                            <DirectEvents>
                                <Click OnEvent="btnSendMail_Click">
                                    <EventMask ShowMask="true" Msg="Đang gửi..." />
                                    <ExtraParams>
                                        <ext:Parameter Name="name" Value="btnDel"></ext:Parameter>
                                    </ExtraParams>
                                    <Confirmation ConfirmRequest="true"
                                        Title="Thông Báo" Message="Bạn có muốn gửi mail cho khách hàng này không ?">
                                    </Confirmation>
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                            <ext:ToolbarSeparator />
                        <ext:Button runat="server" Text="Thêm khách hàng" Icon="Add" ID="btnAddCustomer" MarginSpec="0 8 0 0">
                            <DirectEvents>
                                <Click OnEvent="btnAddCustomer_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:ToolbarSeparator />
                        <ext:Button runat="server" Text="Xoá khách hàng" Icon="Cancel" ID="btnDelMaterial" MarginSpec="0 8 0 0">
                            <DirectEvents>
                                <Click OnEvent="btnDelMaterial_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                    <ExtraParams>
                                        <ext:Parameter Name="name" Value="btnDel"></ext:Parameter>
                                    </ExtraParams>
                                    <Confirmation ConfirmRequest="true"
                                        Title="Thông Báo" Message="Bạn có muốn xoá khách hàng này không ?">
                                    </Confirmation>
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:ToolbarSeparator />
                        <ext:Button runat="server" Text="Huỷ bỏ" Icon="Decline" ID="btnCancelPopUp">
                            <DirectEvents>
                                <Click OnEvent="btnCancelPopUp_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:Label runat="server" ID="txtEmailTest" Hidden="True"/>
                    </Items>
                </ext:Toolbar>
                <ext:Panel
                runat="server" 
                Layout="ColumnLayout">
                <Items>
                    <ext:Panel ID="Panel3"
                        runat="server" 
                        Width="218"
                        Frame="True"
                        MarginSpec="0 5 0 0"
                        Height="520">
                        <Items>
                            <ext:FormPanel ID="FormPanelCustomerCare" runat="server"
                                AutoHeight="true"
                                BodyPadding="4"
                                Frame="true"
                                DefaultAnchor="100%">
                                <Items>
                                    <ext:TextField ID="txtIDCustomerCare" runat="server" FieldLabel="ID" LabelAlign="Right" Hidden="true" />
                                    <ext:TextField ID="txtIDForm" runat="server" FieldLabel="ID" LabelAlign="Right" Hidden="true" />
                                    <ext:Label runat="server" LabelWidth="83" LabelAlign="Top" Text="Mã" />
                                    <ext:FieldContainer
                                            runat="server"
                                            AnchorHorizontal="100%"
                                            Layout="HBoxLayout">
                                            <Items>
                                            <ext:TextField ID="txtCustomerCareCode" runat="server" AllowBlank="False" Width="165" Margins="8 3 0 0" />
                                            <ext:Button runat="server" Text="" Icon="Reload" ID="btnRefreshCustomerCareCode" ToolTip="Click vào để tải lại mã" Margins="8 3 0 0">
                                                <DirectEvents>
                                                    <Click OnEvent="btnRefreshCustomerCareCode_Click">
                                                        <EventMask ShowMask="true" Msg="Đang tải..." />
                                                    </Click>
                                                </DirectEvents>
                                            </ext:Button>
                                            </Items>
                                        </ext:FieldContainer>
                                    <ext:Label runat="server" LabelWidth="83" LabelAlign="Top" Text="Loại biểu mẫu" Margins="8 3 0 0" />
                                    <ext:FieldContainer
                                        runat="server"
                                        AnchorHorizontal="100%"
                                        Layout="HBoxLayout">
                                        <Items>
                                            <ext:TextField ID="txtFormName" runat="server" AllowBlank="False" Width="140" Margins="8 3 0 0" />
                                                <ext:Button runat="server" Text="" Icon="BulletGet" ID="btnOrderCode" ToolTip="Đến danh sách" Margins="8 3 0 0">
                                                <DirectEvents>
                                                    <Click OnEvent="btnOrderCode_Click">
                                                        <EventMask ShowMask="true" Msg="Đang tải..." />
                                                    </Click>
                                                </DirectEvents>
                                            </ext:Button>
                                                <ext:Button runat="server" Text="" Icon="Delete" ID="btnReloadText" ToolTip="Xem trước biểu mẫu" Margins="8 3 0 0">
                                                <DirectEvents>
                                                    <Click OnEvent="btnReloadText_Click">
                                                        <EventMask ShowMask="true" Msg="Đang tải..." />
                                                    </Click>
                                                </DirectEvents>
                                                </ext:Button>
                                        </Items>
                                    </ext:FieldContainer>
                                    <ext:Label runat="server" LabelWidth="83" LabelAlign="Top" Text="Ngày bắt đầu" Margins="8 3 0 0" />
                                    <ext:DateField ID="txtDateBegin" runat="server" AllowBlank="False" Width="250" MarginSpec="8 3 5 0" />
                                    <ext:Label runat="server" LabelWidth="83" LabelAlign="Top" Text="Ngày kết thúc" MarginSpec="8 3 8 0" />
                                    <ext:DateField ID="txtDateEnd" runat="server" AllowBlank="False" Width="250" MarginSpec="8 3 5 0" />
                                    <ext:Label runat="server" LabelWidth="83" LabelAlign="Top" Text="Gửi mail tự động" MarginSpec="8 3 8 0" />
                                    <ext:Checkbox ID="chkCheck" runat="server" AnchorHorizontal="100%" Height="30" MarginSpec="5 0 0 0"/>
                                    <ext:Label runat="server" LabelWidth="83" LabelAlign="Top" Text="Tiêu đề Mail" MarginSpec="8 3 8 0" />
                                    <ext:TextField ID="txtTitileSubject" runat="server" AllowBlank="False" AnchorHorizontal="100%" MarginSpec="5 0 0 0"/>
                                    <ext:Label runat="server" LabelWidth="83" LabelAlign="Top" Text="Nội dung Mail" MarginSpec="0 3 8 0" />
                                    <ext:HtmlEditor ID="txtNote" runat="server" AllowBlank="False" AnchorHorizontal="100%" Height="136" MarginSpec="5 0 0 0"/>
                                </Items>
                            </ext:FormPanel>
                        </Items>
                    </ext:Panel>
                    <ext:Panel
                        runat="server" 
                        Width="736"
                        Layout="Fit" 
                        Border="False"
                        Height="473">
                        <Items>
                            <ext:GridPanel
                                ID="grCustomerCare_Detail"
                                Cls="grid-double"
                                runat="server"
                                EnableColumnMove="true"
                                AutoWidth="true"
                                AutoScroll="true"
                                Layout="Fit"
                                Height="190">
                                <Store>
                                    <ext:Store
                                        ID="StoreCustomerCare_Detail"
                                        runat="server"
                                        OnReadData="StoreCustomerCare_Detail_RefreshData">
                                        <Model>
                                            <ext:Model runat="server" IDProperty="ID_Detail">
                                                <Fields>
                                                    <ext:ModelField Name="ID_CustomerCare" Type="Int" />
                                                    <ext:ModelField Name="Customer_ID" Type="Int" />
                                                    <ext:ModelField Name="Subjects" Type="String" />
                                                    <ext:ModelField Name="Content" Type="String" />
                                                    <ext:ModelField Name="Users_Id" Type="Int" />
                                                    <ext:ModelField Name="Flag" Type="Int" />
                                                    <ext:ModelField Name="Customer_Alias" Type="String" />
                                                    <ext:ModelField Name="Customer_Name" Type="String" />
                                                    <ext:ModelField Name="Customer_Address" Type="String" />
                                                    <ext:ModelField Name="Contact_Email" Type="String" />
                                                </Fields>
                                            </ext:Model>
                                        </Model>
                                    </ext:Store>
                                </Store>
                                <ColumnModel runat="server">
                                    <Columns>
                                        <ext:RowNumbererColumn Text="STT" runat="server" Width="30" Align="Center" />
                                        <ext:Column runat="server" Text="Mã khách hàng" Width="100" DataIndex="Customer_Alias" />
                                        <ext:Column runat="server" Text="Tên khách hàng" Width="100" DataIndex="Customer_Name" />
                                        <ext:Column runat="server" Text="Email KH" Width="100" DataIndex="Contact_Email" />
                                        <ext:Column runat="server" Text="Email (Khác)" Width="90" DataIndex="Subjects">
                                            <Editor>
                                                <ext:TextField ID="txtEmail" runat="server"/>
                                            </Editor>
                                        </ext:Column>
                                        <ext:Column runat="server" Text="Nội dung (Nếu có)" Width="107" DataIndex="Content">
                                            <Editor>
                                                <ext:TextArea ID="txtContent" runat="server"/>
                                            </Editor>
                                        </ext:Column>
                                        <ext:Column runat="server" Text="Địa chỉ" Width="261" DataIndex="Customer_Address" />
                                    </Columns>
                                </ColumnModel>
                                <Plugins>
                                    <ext:RowEditing runat="server" SaveBtnText="Cập nhật" CancelBtnText="Hủy bỏ">
                                        <DirectEvents>
                                            <Edit OnEvent="UpdateMaterials_Click">
                                                <EventMask ShowMask="true" Msg="Đang tải..." />
                                                <ExtraParams>
                                                    <ext:Parameter Name="grCustomerCare_Detail" Value="Ext.encode(#{grCustomerCare_Detail}.getRowsValues({selectedOnly : true}))" Mode="Raw" />
                                                </ExtraParams>
                                            </Edit>
                                        </DirectEvents>
                                    </ext:RowEditing>
                                </Plugins>
                                <SelectionModel>
                                    <ext:CheckboxSelectionModel runat="server" Mode="Multi"/>
                                </SelectionModel>
                                <DockedItems>
                                    <ext:Toolbar runat="server" Dock="Bottom" AnchorHorizontal="100%">
                                        <Items>
                                            <ext:PagingToolbar runat="server" StoreID="StoreCustomerCare_Detail" EmptyMsg="Không có dữ liệu" BeforePageText="Trang" AfterPageText="của {0}" LastText="Cuối" NextText="Kế tiếp" PrevText="Trở lại" FirstText="Đầu" RefreshText="Làm tươi" DisplayInfo="true" DisplayMsg="Trang {0} - {1} của {2}" />
                                        </Items>
                                    </ext:Toolbar>
                                </DockedItems>
                            </ext:GridPanel>
                        </Items>
                    </ext:Panel>
                </Items>
                </ext:Panel>
            </Items>
        </ext:Window>
        <%-----------Form--------------------%>
        <ext:Window ID="WindowViewForm" runat="server"
            Title="Xem trước biểu mẫu"
            DefaultAnchor="100%"
            Width="829"
            Height="400"
            Hidden="true"
            AutoScroll="false"
            Maximizable="False"
            Minimizable="False"
            AutoDataBind="true"
            Region="Center"
            Resizable="False"
            Modal="true"
            Layout="Fit"
            HideMode="Offsets"
            Constrain="True">
            <Items>
                <ext:GridPanel
                    ID="grForm"
                    runat="server"
                    Cls="grid-double"
                    EnableColumnMove="true"
                    Border="False">
                    <Store>
                        <ext:Store
                            ID="StoreForm"
                            runat="server"
                            OnReadData="StoreForm_RefreshData"
                            PageSize="20">
                            <Model>
                                <ext:Model runat="server" IDProperty="ID_Form" GroupField="Form_Name">
                                    <Fields>
                                        <ext:ModelField Name="ID_Form" Type="Int" />
                                        <ext:ModelField Name="Form_Code" Type="String" />
                                        <ext:ModelField Name="Form_Name" Type="String" />
                                        <ext:ModelField Name="CreateDate" Type="Date" />
                                        <ext:ModelField Name="AttFile" Type="String" />
                                        <ext:ModelField Name="Note" Type="String" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel runat="server">
                        <Columns>
                            <ext:RowNumbererColumn Text="STT" runat="server" Width="30" Align="Center" />
                            <ext:Column runat="server" Text="Mã biểu mẫu" Width="100" DataIndex="Form_Code"/>
                            <ext:Column runat="server" Text="Tên biểu mẫu" Width="250" DataIndex="Form_Name"/>
                            <ext:DateColumn runat="server" Text="Ngày tạo" Width="200" DataIndex="CreateDate" Format="dd-MM-yyyy" Align="Center"/>
                            <ext:Column runat="server" Text="Tệp tin" DataIndex="AttFile" Flex="1" Align="Left"/>
                        </Columns>
                    </ColumnModel>
                    <SelectionModel>
                        <ext:CellSelectionModel runat="server">
                            <DirectEvents>
                                <Select OnEvent="CellForm_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Select>
                            </DirectEvents>
                        </ext:CellSelectionModel>
                    </SelectionModel>
                    <Features>
                        <ext:Grouping
                            runat="server" 
                            HideGroupedHeader="true"
                            GroupByText="Xem theo phân nhóm"
                            ShowGroupsText="Phân nhóm"
                            GroupHeaderTplString="{name} ({rows.length} danh mục con {[values.rows.length > 1 ? '' : '']})"
                            StartCollapsed="True" />
                    </Features>
                    <View>
                        <ext:GridView runat="server" StripeRows="true" />
                    </View>
                    <DockedItems>
                        <ext:Toolbar runat="server" Dock="Bottom" AnchorHorizontal="100%">
                            <Items>
                                <ext:PagingToolbar runat="server" StoreID="StoreForm" BeforePageText="Trang" AfterPageText="của {0}" LastText="Cuối" NextText="Kế tiếp" PrevText="Trở lại" FirstText="Đầu" RefreshText="Làm tươi" DisplayInfo="true" DisplayMsg="Trang {0} - {1} của {2}" />
                            </Items>
                        </ext:Toolbar>
                    </DockedItems>
                </ext:GridPanel>
            </Items>
        </ext:Window>
        <%--------------Customer-----------------%>
        <ext:Window ID="WindowCustomerCare" runat="server"
            Title="Thông khách hàng"
            DefaultAnchor="100%"
            Width="829"
            Height="400"
            Hidden="true"
            AutoScroll="false"
            Maximizable="False"
            Minimizable="False"
            AutoDataBind="true"
            Region="Center"
            Resizable="False"
            Modal="true"
            Layout="Fit"
            HideMode="Offsets"
            Constrain="True">
            <Content>
                <ext:GridPanel
                    ID="grCustomerCareAdd"
                    Border="True"
                    runat="server"
                    AutoWidth="true"
                    AutoScroll="true"
                    Cls="gird"
                    EnableColumnMove="true">
                    <Store>
                        <ext:Store
                            ID="StoreCustomerCareAdd"
                            runat="server"
                            OnReadData="StoreCustomerCareAdd_RefreshData"
                            PageSize="14">
                            <Model>
                                <ext:Model runat="server" IDProperty="Customer_ID">
                                    <Fields>
                                        <ext:ModelField Name="Customer_ID" Type="Int" />
                                        <ext:ModelField Name="Customer_Alias" Type="String" />
                                        <ext:ModelField Name="Customer_Name" Type="String" />
                                        <ext:ModelField Name="Customer_Type_Name" Type="String" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel runat="server">
                        <Columns>
                            <ext:RowNumbererColumn runat="server" Width="30" Align="Center" />
                            <ext:Column runat="server" Text="Mã khách hàng" Width="100" DataIndex="Customer_Alias" Align="Left"></ext:Column>
                            <ext:Column runat="server" Text="Tên khách hàng" DataIndex="Customer_Name" Align="Left"></ext:Column>
                            <ext:Column runat="server" Text="Loại khách hàng" DataIndex="Customer_Type_Name" Align="Left" Flex="1"></ext:Column>
                        </Columns>
                    </ColumnModel>
                    <SelectionModel>
                        <ext:CheckboxSelectionModel runat="server" Mode="Multi" />
                    </SelectionModel>
                    <TopBar>
                        <ext:Toolbar runat="server">
                            <Items>
                                <ext:Button ID="btnSelectCustomerCare" runat="server" Text="Chọn khách hàng" Icon="Accept" ToolTip="Chọn khách hàng">
                                    <DirectEvents>
                                        <Click OnEvent="btnSelectCustomerCare_Click">
                                            <EventMask ShowMask="true" Msg="Đang tải..." />
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                                <ext:ToolbarSeparator />
                                <ext:SelectBox
                                    ID="SelectBoxTypeCustomer"
                                    runat="server"
                                    Cls="x-select-box"
                                    DisplayField="Customer_Type_Name"
                                    ValueField="Customer_Type_ID"
                                    MarginSpec="0 8 0 0"
                                    EmptyText="Chọn loại khách hàng">
                                    <Store>
                                        <ext:Store ID="StoreTypeCustomer" runat="server">
                                            <Model>
                                                <ext:Model runat="server">
                                                    <Fields>
                                                        <ext:ModelField Name="Customer_Type_Name" />
                                                        <ext:ModelField Name="Customer_Type_ID" />
                                                    </Fields>
                                                </ext:Model>
                                            </Model>
                                        </ext:Store>
                                    </Store>
                                    <DirectEvents>
                                        <Select OnEvent="SelectBoxTypeCustomer_Change">
                                            <EventMask ShowMask="true" Msg="Đang tải..."></EventMask>
                                        </Select>
                                    </DirectEvents>
                                </ext:SelectBox>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <DockedItems>
                        <ext:Toolbar runat="server" Dock="Bottom" AnchorHorizontal="100%">
                            <Items>
                                <ext:TriggerField ID="txtSearchChild" runat="server" Width="200" EnableKeyEvents="true" MarginSpec="0 8 0 0">
                                    <Triggers>
                                        <ext:FieldTrigger Icon="Search" />
                                    </Triggers>
                                    <DirectEvents>
                                        <TriggerClick OnEvent="SearchChild_Event">
                                                <EventMask ShowMask="true" Msg="Đang tải..." />
                                        </TriggerClick>
                                        <SpecialKey OnEvent="SearchChild_Event" Before="return e.getKey() == Ext.EventObject.ENTER;">
                                                <EventMask ShowMask="true" Msg="Đang tải..." />
                                        </SpecialKey>
                                    </DirectEvents>
                                </ext:TriggerField>
                                <ext:ToolbarSeparator />
                                <ext:PagingToolbar runat="server" StoreID="StoreCustomerCareAdd" BeforePageText="Trang" AfterPageText="của {0}" LastText="Cuối" NextText="Kế tiếp" PrevText="Trở lại" FirstText="Đầu" RefreshText="Làm tươi" DisplayInfo="true" DisplayMsg="Trang {0} - {1} của {2}" />
                            </Items>
                        </ext:Toolbar>
                    </DockedItems>
                </ext:GridPanel>
            </Content>
        </ext:Window>
    </Content>
</ext:Panel>